package com.hxjc.bankagent.old.merchant.service.outbound;

import com.cmbc.afw.util.tx.message.Response;
import com.cmbc.afw.utils.httpclient.OutBoundServiceUtils;
import com.hxjc.bankagent.old.config.BankBaseConfig;
import com.hxjc.bankagent.old.merchant.entity.MerchantRequest;
import com.hxjc.bankagent.old.merchant.entity.MerchantResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * MerchantOutboundService
 *
 * @author yinz
 * @date 2018/5/8
 */
@Service
public class MerchantOutboundService {

    private Logger logger = LoggerFactory.getLogger(MerchantOutboundService.class);

    @Autowired
    BankBaseConfig bankConfig;

    public MerchantResponse execute(MerchantRequest request) {
        try {
            Response response = OutBoundServiceUtils.execute(bankConfig.getClientConfig(), request);
            logger.info("得到的响应为：" + response);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}
